LassoScript Utility
Basics Browse Detail

[String->PadTrailing]

Tag Link [String->PadTrailing] Category String
Type Member Source Available No
Support Preferred Version 7.0
Change Unchanged Data Source Any
Output Type None Security None
Implementation LCAPI Sets Lasso 8.5, Lasso 8.0, Lasso 7.0

Description

[String->PadTrailing] modifies the base string in-place by padding the end of the string to the specified length. An optional second parameter specifies the padding character. The padding character defaults to a space.

Syntax

[Variable: 'myString' = 'String Value']
[$myString->(PadTrailing: Length)]
[Variable: 'myString']

<?LassoScript
Variable: 'myString' = 'String Value';
$myString->(PadTrailing: Length, 'Char')]
Output: $myString;
?>

Parameters

Required Parameters
Length The desired length for the string.
Optional Parameters
Padding Char The passing character to use. Defaults to space.

Examples

To pad the end of a string to a desired length:

Use the [String->PadTrailing] tag. The following example pads the string out to 32 characters by adding asterisks to the end of the string.

[Variable: 'myString' = 'A quick brown fox']
[$myString->(PadTrailing: 32, '*')]
[Output: $myString]

A quick brown fox***************

Related Tags

Category Tags